package com.ym.soso.enums;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.util.StdConverter;
import com.ym.common.annotations.EnumDescription;
import com.ym.common.constant.DictEnum;


/**
 * @Author wenbo
 * @Date 2020/1/8 16:44
 **/

@EnumDescription("挂号方式")
public enum RegistryWayEnum implements DictEnum {
    //--------------------start-----------------

    /**
     * 公众号
     */
    THE_PUBLIC("01","公众号"),
    /**
     * 小程序
     */
    SMALL_PROGRAM("02","小程序"),
    /**
     * 电话
     */
    THE_PHONE("03","电话"),
    /**
     * app
     */
    APPLICATION("04","app"),
    /**
     * 官网
     */
    WEBSITE("05","官网"),

    //--------------------end-------------------
    ;

    private String key;

    private String value;

    RegistryWayEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public String getKey() {
        return this.key;
    }

    @Override
    public String getValue() {
        return this.value;
    }

    /**
     * 序列化使用
     */
    public static class Covert extends StdConverter<String, JSONObject> {
        @Override
        public JSONObject convert(String value) {
            return DictEnum.valueOfJson(RegistryWayEnum.class,value);
        }
    }
}
